package com.originit.product.client;

import com.originit.product.common.input.CartInput;
import com.originit.product.common.output.ProductOutput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("product")
public interface ProductClient {

    @PostMapping("/product/listById")
    List<ProductOutput> listById(@RequestBody List<String> ids);

    @PutMapping("/product/stock")
    void minusStockByIds(@RequestBody List<CartInput> productStockList);
}
